// 封装所有与角色相关的 api
import instance from '@/utils/request.js'


// 根据ID更新权限点详情
export function updatePermissionApi(data) {
  return instance({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}

// 根据ID获取权限点详情
export function getDetailPermissionApi(id) {
  return instance({
    url: `/sys/permission/${id}`,
    method: 'GET',
  })
}

// 根据id删除权限点
export function delPermissionApi(id) {
  return instance({
    url: `/sys/permission/${id}`,
    method: 'DELETE',
  })
}

// 添加权限点
export function addPermissionApi(data) {
  return instance({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}

// 获取所有权限点
export function getAllPermissionApi() {
  return instance({
    url: '/sys/permission',
    method: 'GET',
  })
}
